.. This file was automatically converted from MediaWiki syntax. If some markup is wrong, looks weird or doesn't make sense, feel free to fix it. Please remove this comment once this file was manually checked and no "strange ReST" artifacts remain. .. _sample-cube-map: Sample Cube Map =============== The following sample code loads up an environment, puts the camera in the center of it, and generates the six faces of a cube map from the point of view of the camera: +--------------------------------------------------------------------------------+ | :: | | | | scene = loader.loadModel('bvw-f2004--streetscene/street-scene.egg') | | scene.reparentTo(render) | | scene.setZ(-2) | | base.saveCubeMap('streetscene_cube_#.jpg', size = 256) | +--------------------------------------------------------------------------------+ These are the six faces generated: Right: .. figure:: Streetscene_cube_0.jpg :alt: Streetscene_cube_0.jpg Left: .. figure:: Streetscene_cube_1.jpg :alt: Streetscene_cube_1.jpg Front: .. figure:: Streetscene_cube_2.jpg :alt: Streetscene_cube_2.jpg Back: .. figure:: Streetscene_cube_3.jpg :alt: Streetscene_cube_3.jpg Top: .. figure:: Streetscene_cube_4.jpg :alt: Streetscene_cube_4.jpg Bottom: .. figure:: Streetscene_cube_5.jpg :alt: Streetscene_cube_5.jpg And when they are assembled into a cube map, it looks like this: .. figure:: Streetscene_cube.jpg :alt: The_six_faces_as_a_cube Or, when we apply that cube map to a sphere, you can see there are absolutely no seams between the edges: .. figure:: Streetscene_sphere.jpg :alt: The_cube_map_applied_to_a_sphere